package com.blast.manager.delay.presenter

import android.content.Context
import android.view.View
import com.wxl.common.base.AbsActivity
import com.wxl.common.life.ViewModelQuick
import com.wxl.common.viewmodel.AbsPresenter

abstract class AbsDelayPresenter : AbsPresenter() {

    open lateinit var rootView: View
    open lateinit var context: Context

    override fun onCreated(vararg args: Any) {
        rootView = args[0] as View
        context = rootView.context
        onDelayCreated(*args)
    }

    abstract fun onDelayCreated(vararg args: Any)

    fun <T : AbsPresenter> getPresenter(clazz: Class<T>): T {
        return ViewModelQuick.get(context as AbsActivity, clazz)
    }
}